package org.duang.kit;


import org.duang.logs.LogBackLogger;
import org.duang.logs.Logger;

public class LogKit {
	
	private static java.util.concurrent.locks.ReentrantLock lock = new java.util.concurrent.locks.ReentrantLock();
	private static LogKit logKit;
	private static Logger log;
	
	public static LogKit duang() {
		synchronized(lock){
			if(null == logKit){
				logKit = new LogKit();				
			}
		}
		return logKit;
	}
	
	public LogKit classes(Class<?> clazz) {
		log = LogBackLogger.getLogger(clazz);		
		return this;
	}
	
	public static Logger getLogger(Class<?> clazz) {
		return (Logger)LogBackLogger.getLogger(clazz);	
	}
	
	
	public void print(String msg) {
		 log.print(msg);
	}
	
	public void print(String msg, Throwable t) {
		 log.print(msg, t);
	}
}
